<script lang="ts">
import { defineComponent, reactive, toRefs, getCurrentInstance } from 'vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en'

export default defineComponent({
  name: 'App',
  setup() {
    const { proxy } = getCurrentInstance()
    const state = reactive({
      locale: proxy.$i18n.locale.includes('zh') ? zhCn : en
    })

    return {
      ...toRefs(state)
    }
  }
})
</script>

<template>
  <el-config-provider :locale="locale">
    <router-view />
  </el-config-provider>
</template>

<style>
@import '@/style/main.css';
</style>
